import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsCommentsController } from '../../../controllers';
const uctoocmsCommentsRouter = new Router();
const cmsCommentsController = new uctooCmsCommentsController();

uctoocmsCommentsRouter.post('/add', requireUser, cmsCommentsController.add);
uctoocmsCommentsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_comments'), cmsCommentsController.edit);
uctoocmsCommentsRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_comments'), cmsCommentsController.delete);

//For getting cmsComments with permission control
uctoocmsCommentsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_comments'), cmsCommentsController.getSingle);
uctoocmsCommentsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_comments'), cmsCommentsController.getMany);
uctoocmsCommentsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_comments'), cmsCommentsController.getMany);

//#endregion AutoCreateCode
export default uctoocmsCommentsRouter;
